import {listDrug} from "@/api/pharmacy/drug"
import {listPharmacy} from "@/api/pharmacy/pharmacy"
import {listPharmacyOperate} from "@/api/pharmacy/pharmacyOperate"

export default {
  data() {
    return {
      drugList: [],
      pharmacyList: [],
      operateList: [],
      loading: false,
      loadAllParams: {
        pageNum: 1,
        pageSize: 10000,
      }
    };
  },
  methods: {
    getDrugNameList() {
      this.loading = true;
      listDrug(this.loadAllParams).then((response) => {
        this.drugList = response.rows;
        this.loading = false;
      });
    },
    getOperateNameList() {
      this.loading = true;
      listPharmacyOperate(this.loadAllParams).then((response) => {
        this.operateList = response.rows;
        this.loading = false;
      });
    },
    getPharmacyNameList() {
      this.loading = true;
      listPharmacy(this.loadAllParams).then((response) => {
        this.pharmacyList = response.rows;
        this.loading = false;
      });
    }
  },
  created() {
    this.getDrugNameList();
    this.getPharmacyNameList();
    this.getOperateNameList();
  }
};
